package com.cjm.one.goods.client;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.common.constant.ServerConstants;
import com.cjm.one.common.result.Result;
import com.cjm.one.model.goods.entity.GoodsSku;
import com.cjm.one.model.goods.vo.GoodsSkuVo;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = ServerConstants.SERVER_ONE_GOODS)
public interface GoodsCollectClient {
    @GetMapping("/app/goods/collect/add")
    @Operation(summary = "添加商品收藏")
    Result<Boolean> insertCollect(@RequestParam("goodsId") Long goodsId);

    @DeleteMapping("/app/goods/collect/delete")
    @Operation(summary = "删除商品收藏")
    Result<Boolean> deleteCollect(@RequestParam("id") Long id);

    @DeleteMapping("/app/goods/collect/delete/batch")
    @Operation(summary = "批量删除商品收藏")
    Result<Boolean> deleteCollectBatch(@RequestParam("ids") Long[] ids);
    @GetMapping("/app/goods/collect/check/sku/{id}")
    @Operation(summary = "检查商品是否收藏")
    Result<Boolean> checkGoodsCollect(@PathVariable("id") Long id);
    @GetMapping("/app/goods/collect/list")
    @Operation(summary = "查询当前用户收藏的商品列表")
    Result<Page<GoodsSkuVo>> getGoodsByCollection(@RequestParam(name = "current",defaultValue = "1") Long current, @RequestParam(name = "size",defaultValue = "10") Long size);
}
